<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>计算器</title>
    <script src="C:\Users\lh\github\VueStudy\vue.min.js" charset="utf-8"></script>
  </head>
  <body>
    <div id="calu">
      <input type="text" v-model = "num1" placeholder="第一个数字">
      +
      <input type="text" v-model = "num2" placeholder="第二个数字">
      =
      {{result()}}
    </div>
    <script type="text/javascript">
      var app = new Vue({
        el: '#calu',
        data: {
          num1: '',
          num2: ''
        },
        methods: {
          result: function()
          {

            return parseInt(this.num1)+parseInt(this.num2);
          }
        }
      }
      )
    </script>
  </body>
</html>
